package cn.ichiva.puppet.example.base.p2;

import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.fxml.FXML;
import javafx.fxml.impl.AbstractPuppetComponent;
import javafx.scene.control.Label;
import javafx.scene.layout.VBox;

/**
 * 条件渲染,事件绑定
 */
public class L1P1Box extends AbstractPuppetComponent {
    @FXML
    StringProperty labelText = new SimpleStringProperty("父组件参数");
    @FXML
    StringProperty fieldText = new SimpleStringProperty("父组件参数值");

    @Override
    public CharSequence render() {
        imports(VBox.class, Label.class, L1P1LabelTextField.class);
        return """
                <VBox>
                    <Label text="组件化传参" />
                    <L1P1LabelTextField props="labelText,fieldText" />
                </VBox>
                """;
    }
}
